import React, { Component } from 'react';
import '../../css/yxmain.scss'
class cartMain extends Component {
    componentDidMount(){
        // this.props.getMsg.bind(this, 'aaaaa')
    }
    constructor(porps){
        super(porps)
        console.log(this.porps)
    }
    state={
        total:1,
        products: [
            {
              id: 1,
              product_title: "黑科技分区控温，95%鹅绒抗菌儿童鹅绒被",
              img_url:
                "https://yanxuan-item.nosdn.127.net/50da19cc467b002f15a8eb7a5663408e.png?type=webp&imageView&thumbnail=160x0&quality=75",
              price: "588",
              origin_price: 599,
              num: 1,
              checked: true,
            },]
    }
    render() {
        return (
            <div className="cart-main">
                <button onClick={this.props.getMsg.bind(this, 'aaaaa')}>发送消息</button>
               <div className="mian-item">
                   <div className="item-left">
                       <i className="iconfont icon-xuanzhong-2"></i>
                   </div>
                   <div className="item-mid">
                       <img src={this.state.products[0].img_url} alt=""/>
                   </div>
                   <div className="item-right">
                       <div className="right-top">{this.state.products[0].product_title}</div>
                       <div className="right-und">
                           <div className="und-left">
                               <span className="price">
                                   ￥{this.state.products[0].price}
                               </span>
                               <span className="origin-price">
                                   ￥{this.state.products[0].origin_price}
                               </span>
                           </div>
                           <div className="und-right">
                                <i className="iconfont icon-sub"></i>
                                <span className="num">
                                    {this.state.products[0].num}
                                </span>
                                <i className="iconfont icon-CombinedShape"></i>
                           </div>
                       </div>
                   </div>
               </div>
            </div>
        );
    }
}

export default cartMain;
